﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Collections;
using System.Data;
using System.Windows.Forms;

namespace PMSSys
{
    public class icdController
    {
        private DBconnentor dbConnect;
        public DBconnentor DbConnect
        {
            set { dbConnect = value; }
            get { return dbConnect; }
        }

        public ICD objectFiller(ICD pObject)
        {
            string str = "SELECT * FROM incdata WHERE p_id = " + pObject.PatientID.ToString();
            DataTable temp = dbConnect.view(str);
            IEnumerator iter = temp.Rows[0].ItemArray.GetEnumerator();
            iter.MoveNext();
            iter.MoveNext();
            iter.MoveNext();
            
            pObject.Chiefcomplaint = (string)iter.Current;
            iter.MoveNext();
            pObject.Hpi = (string)iter.Current;
            iter.MoveNext();
            pObject.Bcg = (bool)iter.Current;
            iter.MoveNext();
            pObject.Dtp = (bool)iter.Current;
            iter.MoveNext();
            pObject.Opvipv = (bool)iter.Current;
            iter.MoveNext();
            pObject.Hib = (bool)iter.Current;
            iter.MoveNext();
            pObject.Hepb = (bool)iter.Current;
            iter.MoveNext();
            pObject.Mmr = (bool)iter.Current;
            iter.MoveNext();
            pObject.Vari = (bool)iter.Current;
            iter.MoveNext();
            pObject.Hpv = (bool)iter.Current;
            iter.MoveNext();
            pObject.Otherimmunizationcheck = (bool)iter.Current;
            iter.MoveNext();
            pObject.Otherimmunization = (string)iter.Current;
            iter.MoveNext();
            pObject.Familycancerbox = (bool)iter.Current;
            iter.MoveNext();
            pObject.Familycancer = (string)iter.Current;
            iter.MoveNext();
            pObject.Familyhemo = (bool)iter.Current;
            iter.MoveNext();
            pObject.Familyvwf = (bool)iter.Current;
            iter.MoveNext();
            pObject.Familyanemiabox = (bool)iter.Current;
            iter.MoveNext();
            pObject.Familyanemia = (string)iter.Current;
            iter.MoveNext();
            pObject.Familyothersnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Familyothers = (bool)iter.Current;
            iter.MoveNext();
            pObject.Pastillnessbox = (bool)iter.Current;
            iter.MoveNext();
            pObject.Pastillness = (string)iter.Current;
            iter.MoveNext();
            pObject.Pastsurgerybox = (bool)iter.Current;
            iter.MoveNext();
            pObject.Pastsurgery = (string)iter.Current;
            iter.MoveNext();
            pObject.Pastmedicationsbox = (bool)iter.Current;
            iter.MoveNext();
            pObject.Pastmedications = (string)iter.Current;
            iter.MoveNext();
            pObject.Pastallergybox = (bool)iter.Current;
            iter.MoveNext();
            pObject.Allergies = (string)iter.Current;
            iter.MoveNext();
            pObject.Envirohistory = (string)iter.Current;
            iter.MoveNext();
            pObject.Psychohistory = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalt = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalweight = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalheight = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalbsa = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalrr = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalhr = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalbp = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalpain = (string)iter.Current;
            iter.MoveNext();
            pObject.Vitalperform_lev = (string)iter.Current;
            iter.MoveNext();
            pObject.Skinlesions = (bool)iter.Current;
            iter.MoveNext();
            pObject.Skinlesionsnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Skinnolesions = (bool)iter.Current;
            iter.MoveNext();
            pObject.Skinlocation = (string)iter.Current;
            iter.MoveNext();
            pObject.Heent_conj_normal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_conj_pale = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_sclerae_normal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_sclerae_yellow = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_thyr_normal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_thyr_enlarged = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_thyr_enlargednotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Heent_crn_normal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_crn_enlarged = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_crn_enlargednotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Heent_tonsils_normal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_tonsils_enlarged = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_tonsils_exudates = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_tonsils_beefy = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_tm_normal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_tm_perforated = (bool)iter.Current;
            iter.MoveNext();
            pObject.Heent_tm_discharged = (bool)iter.Current;
            iter.MoveNext();
            pObject.Chestrythm_regu = (bool)iter.Current;
            iter.MoveNext();
            pObject.Chestrythm_irreg = (bool)iter.Current;
            iter.MoveNext();
            pObject.Chestrythm_murmur = (bool)iter.Current;
            iter.MoveNext();
            pObject.Chestrythm_thrill = (bool)iter.Current;
            iter.MoveNext();
            pObject.Chestbreast_smr = (string)iter.Current;
            iter.MoveNext();
            pObject.Lungsnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Lungsabnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Lungsabnormalnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Extremitiesnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Extremitiesabnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Extremitiesabnormalnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Rectalnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Rectalabnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Rectalabnormalnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Endocrinenormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Endocrineabnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Endocrineabnormalnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Hematologicnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Hematologicabnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Hematologicabnormalnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Genitalianormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Genitaliaabnormal = (bool)iter.Current;
            iter.MoveNext();
            pObject.Genitaliaabnormalnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Smrrating = (string)iter.Current;
            iter.MoveNext();
            pObject.Phys_others = (string)iter.Current;
            iter.MoveNext();
            pObject.Phys_perflevel = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbchgb = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbchct = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcplatelet = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcwbc = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcstabs = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcseg = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcl = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcm = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbce = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcblast = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcreticulyte_count = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcrpi = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcmchc = (bool)iter.Current;
            iter.MoveNext();
            pObject.Cbcmchcnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcmch = (bool)iter.Current;
            iter.MoveNext();
            pObject.Cbcmchnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Cbcmcv = (bool)iter.Current;
            iter.MoveNext();
            pObject.Cbcmcvnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearrbc = (bool)iter.Current;
            iter.MoveNext();
            pObject.Perismearrbcnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearaniso = (bool)iter.Current;
            iter.MoveNext();
            pObject.Perismearanisonotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearpoikilo = (bool)iter.Current;
            iter.MoveNext();
            pObject.Perismearpoikilonotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearwbc = (bool)iter.Current;
            iter.MoveNext();
            pObject.Perismearwbcnotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearb = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearn = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearl = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismear2b = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismeare = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearm = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearblast = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearplatelets = (bool)iter.Current;
            iter.MoveNext();
            pObject.Perismearadeq = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearinc = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismeardec = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearmacro = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearmicro = (string)iter.Current;
            iter.MoveNext();
            pObject.Perismearinterpre = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofblledtime = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofclottime = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofpt = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagproffdp = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofaptt = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofothers = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofviii = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofix = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagproffibri = (string)iter.Current;
            iter.MoveNext();
            pObject.Coagprofdmmers = (string)iter.Current;
            iter.MoveNext();
            pObject.Plateaggregationtests = (string)iter.Current;
            iter.MoveNext();
            pObject.Hemoglobinelectronotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonemsmerythropoiesis = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonemsmgranulopoiesis = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonemsmmegakaryopoiesis = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonemsmothers = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonemsminterpretations = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonemrbiopsydate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Bonemrbiopsynotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Histopathologydate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Histopathologynotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Chromodate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Chromonotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Cytochemdate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Cytochempas = (string)iter.Current;
            iter.MoveNext();
            pObject.Cytochemmpo = (string)iter.Current;
            iter.MoveNext();
            pObject.Cytochemsbb = (string)iter.Current;
            iter.MoveNext();
            pObject.Cytochemothers = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenodate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd3 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd5 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd7 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd10 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenoantihladr = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd13 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd19 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd20 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd22 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd33 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenocd34 = (string)iter.Current;
            iter.MoveNext();
            pObject.Immunophenoothers = (string)iter.Current;
            iter.MoveNext();
            pObject.Bonescandate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Bonescannotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Ctscandate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Ctscannotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Chestxraydate = (DateTime)iter.Current;
            iter.MoveNext();
            pObject.Chestxraynotes = (string)iter.Current;
            iter.MoveNext();
            pObject.Labdataothers = (string)iter.Current;
            iter.MoveNext();
            pObject.Impressiondiagnosis = (string)iter.Current;
            iter.MoveNext();
            pObject.Othernotes = (string)iter.Current;

            return pObject;
        }

        public bool updateICD(ICD icd)
        {

            MySqlCommand query = new MySqlCommand(@"UPDATE incdata SET chiefcompliant = @CHIEFCOMPLIANT, hpi =  @HPI, bcg = @BCG, dtp =  @DTP, opvipv =  @OPVIPV, hib =  @HIB, hepb =  @HEPB , mmr = @MMR, vari = @VARI, hpv = @HPV,otherimmunizationcheck = @OTHER ,otherimmunization =  @OTHERIMMUNIZATION, familycancerbox = @FAMILYCANCERBOX, familycancer=  @FAMILYCANCER, familyhemo = @FAMILYHEMO,
 familyvwf =  @FAMILYVWF,familyanemiabox = @FAMILYANEMIABOX, familyanemia = @FAMILYANEMIA, familyothers = @FAMILYOTHERS, familyothersnotes=@FAMILYOTHERSNOTES, pastillnessbox = @PASTILLNESSBOX, pastillness  =@PASTILLNESS,pastsurgerybox = @PASTSURGERYBOX, pastsurgery= @PASTSURGERY,pastmedicationsbox = @PASTMEDICATIONSBOX ,pastmedications =  @PASTMEDICATIONS, pastallergybox = @PASTALLERGYBOX,allergies = @ALLERGIES, envirohistory = @ENVIROHISTORY, psychohistory =  @PSYCHOHISTORY,
 vitalt = @VITALT, vitalweight =  @VITALWEIGHT, vitalheight = @VITALHEIGHT, vitalbsa = @VITALBSA, vitalrr =  @VITALRR, vitalhr =  @VITALHR, vitalbp = @VITALBP, vitalpain = @VITALPAIN, 
vitalperform_lev = @VITALPERFORM_LEV, skinlesions =@SKINLESIONS, skinlesionsnotes = @SKINLESIONSNOTES,skinnolesions = @SKINNOLESIONS, skinlocation = @SKINLOCATION,
 heent_conj_normal = @HEENT_CONJ_NORMAL, heent_conj_pale = 
 @HEENT_CONJ_PALE, heent_sclerae_normal =  @HEENT_SCLERAE_NORMAL, heent_sclerae_yellow =  @HEENT_SCLERAE_YELLOW, heent_thyr_normal =  @HEENT_THYR_NORMAL, heent_thyr_enlarged =  @HEENT_THYR_ENLARGED, heent_thyr_enlargednotes =  @HEENT_THYR_ENLARGEDNOTES, heent_crn_normal= @HEENT_CRN_NORMAL, heent_crn_enlarged =  @HEENT_CRN_ENLARGED,
 heent_crn_enlargednotes = @HEENT_CRN_ENLARGEDNOTES, heent_tonsils_normal =  @HEENT_TONSILS_NORMAL, heent_tonsils_enlarged = @HEENT_TONSILS_ENLARGED, heent_tonsils_exudates =  @HEENT_TONSILS_EXUDATES, heent_tonsils_beefy =  @HEENT_TONSILS_BEEFY, heent_tm_normal =  @HEENT_TM_NORMAL , heent_tm_perforated = @HEENT_TM_PERFORATED, heent_tm_discharged = @HEENT_TM_DISCHARGED , 
 chestrythm_regu =@CHESTRYTHM_REGU, chestrythm_irreg
 =@CHESTRYTHM_IRREG, chestrythm_murmur =@CHESTRYTHM_MURMUR, chestrythm_thrill =@CHESTRYTHM_THRILL, chestbreast_smr  =@CHESTBREAST_SMR, lungsnormal =@LUNGSNORMAL, lungsabnormal =@LUNGSABNORMAL, lungsabnormalnotes =@LUNGSABNORMALNOTES , extremitiesnormal =@EXTREMITIESNORMAL, extremitiesabnormal =@EXTREMITIESABNORMAL,
 extremitiesabnormalnotes =@EXTREMITIESABNORMALNOTES, rectalnormal =@RECTALNORMAL , rectalabnormal =@RECTALABNORMAL, rectalabnormalnotes =@RECTALABNORMALNOTES, endocrinenormal =@ENDOCRINENORMAL, endocrineabnormal =@ENDOCRINEABNORMAL, endocrineabnormalnotes  =@ENDOCRINEABNORMALNOTES, hematologicnormal=@HEMATOLOGICNORMAL, hematologicabnormal =@HEMATOLOGICABNORMAL,
 hematologicabnormalnotes =@HEMATOLOGICABNORMALNOTES, genitalianormal =@GENITALIANORMAL, genitaliaabnormal =@GENITALIAABNORMAL, genitaliaabnormalnotes=@GENITALIAABNORMALNOTES, smrrating =@SMRRATING, phys_others  =@PHYS_OTHERS, phys_perflevel =@PHYS_PERFLEVEL, cbchgb =@CBCHGB, cbchct =@CBCHCT, cbcplatelet =@CBCPLATELET,
 cbcwbc =@CBCWBC, cbcstabs =@CBCSTABS, cbcseg=@CBCSEG, cbcl =@CBCL, cbcm=@CBCM, cbce =@CBCE , cbcblast=@CBCBLAST, cbcreticulyte_count=@CBCRETICULYTE_COUNT, cbcrpi =@CBCRPI , cbcmchc =@CBCMCHC, cbcmchcnotes =@CBCMCHCNOTES , cbcmch =@CBCMCH , cbcmchnotes=@CBCMCHNOTES,
 cbcmcv =@CBCMCV, cbcmcvnotes  =@CBCMCVNOTES, perismearrbc =@PERISMEARRBC, perismearrbcnotes =@PERISMEARRBCNOTES, perismearaniso  =@PERISMEARANISO, perismearanisonotes =@PERISMEARANISONOTES, perismearpoikilo  =@PERISMEARPOIKILO, perismearpoikilonotes =@PERISMEARPOIKILONOTES, perismearwbc =@PERISMEARWBC, perismearwbcnotes =@PERISMEARWBCNOTES,
 perismearb =@PERISMEARB, perismearn=@PERISMEARN, perismearl =@PERISMEARL, perismear2b  =@PERISMEAR2B, perismeare =@PERISMEARE, perismearm=@PERISMEARM, perismearblast  =@PERISMEARBLAST, perismearplatelets =@PERISMEARPLATELETS , perismearadeq=@PERISMEARADEQ, perismearinc =@PERISMEARINC,
 perismeardec =@PERISMEARDEC, perismearmacro=@PERISMEARMACRO, perismearmicro=@PERISMEARMICRO, perismearinterpre =@PERISMEARINTERPRE, coagprofblledtime =@COAGPROFBLLEDTIME, coagprofclottime =@COAGPROFCLOTTIME, coagprofpt=@COAGPROFPT, coagproffdp=@COAGPROFFDP, coagprofaptt=@COAGPROFAPTT, coagprofothers =@COAGPROFOTHERS,
 coagprofviii =@COAGPROFVIII, coagprofix =@COAGPROFIX, coagproffibri =@COAGPROFFIBRI, coagprofdmmers =@COAGPROFDMMERS, plateaggregationtests =@PLATEAGGREGATIONTESTS, hemoglobinelectronotes=@HEMOGLOBINELECTRONOTES, bonemsmerythropoiesis=@BONEMSMERYTHROPOIESIS , bonemsmgranulopoiesis =@BONEMSMGRANULOPOIESIS, bonemsmmegakaryopoiesis  =@BONEMSMMEGAKARYOPOIESIS,
 bonemsmothers =@BONEMSMOTHERS, bonemsminterpretations=@BONEMSMINTERPRETATIONS, bonemrbiopsydate =@BONEMRBIOPSYDATE , bonemrbiopsynotes=@BONEMRBIOPSYNOTES, histopathologydate =@HISTOPATHOLOGYDATE, histopathologynotes=@HISTOPATHOLOGYNOTES, chromodate =@CHROMODATE, chromonotes =@CHROMONOTES, cytochemdate  =@CYTOCHEMDATE,
 cytochempas =@CYTOCHEMPAS , cytochemmpo=@CYTOCHEMMPO, cytochemsbb=@CYTOCHEMSBB, cytochemothers =@CYTOCHEMOTHERS, immunophenodate =@IMMUNOPHENODATE, immunophenocd3 =@IMMUNOPHENOCD3, immunophenocd5 =@IMMUNOPHENOCD5, immunophenocd7 =@IMMUNOPHENOCD7, immunophenocd10 =@IMMUNOPHENOCD10, immunophenoantihladr =@IMMUNOPHENOANTIHLADR,
 immunophenocd13  =@IMMUNOPHENOCD13, immunophenocd19 =@IMMUNOPHENOCD19, immunophenocd20 =@IMMUNOPHENOCD20, immunophenocd22 =@IMMUNOPHENOCD22, immunophenocd33 =@IMMUNOPHENOCD33, immunophenocd34 =@IMMUNOPHENOCD34, immunophenoothers =@IMMUNOPHENOOTHERS, bonescandate =@BONESCANDATE, bonescannotes =@BONESCANNOTES, ctscandate =@CTSCANDATE,
 ctscannotes =@CTSCANNOTES, chestxraydate =@CHESTXRAYDATE, chestxraynotes =@CHESTXRAYNOTES, labdataothers =@LABDATAOTHERS, impressiondiagnosis =@IMPRESSIONDIAGNOSIS , othernotes=@OTHERNOTES WHERE p_id = @P_ID", dbConnect.getConnection());
            query.Parameters.Add(new MySqlParameter("@P_ID", MySqlDbType.Int32)).Value = icd.PatientID;
            query.Parameters.Add(new MySqlParameter("@CHIEFCOMPLIANT", MySqlDbType.String)).Value = icd.Chiefcomplaint;
            query.Parameters.Add(new MySqlParameter("@HPI", MySqlDbType.String)).Value = icd.Hpi;
            query.Parameters.Add(new MySqlParameter("@BCG", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Bcg);
            query.Parameters.Add(new MySqlParameter("@DTP", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Dtp);
            query.Parameters.Add(new MySqlParameter("@OPVIPV", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Opvipv);
            query.Parameters.Add(new MySqlParameter("@HIB", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Hib);
            query.Parameters.Add(new MySqlParameter("@HEPB", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Hepb);
            query.Parameters.Add(new MySqlParameter("@MMR", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Mmr);
            query.Parameters.Add(new MySqlParameter("@VARI", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Vari);
            query.Parameters.Add(new MySqlParameter("@HPV", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Hpv);
            query.Parameters.Add(new MySqlParameter("@OTHER", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Otherimmunizationcheck);
            query.Parameters.Add(new MySqlParameter("@OTHERIMMUNIZATION", MySqlDbType.String)).Value = icd.Otherimmunization;
            query.Parameters.Add(new MySqlParameter("@FAMILYCANCERBOX", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Familycancerbox);
            query.Parameters.Add(new MySqlParameter("@FAMILYCANCER", MySqlDbType.String)).Value = icd.Familycancer;
            query.Parameters.Add(new MySqlParameter("@FAMILYHEMO", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Familyhemo);
            query.Parameters.Add(new MySqlParameter("@FAMILYVWF", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Familyvwf);
            query.Parameters.Add(new MySqlParameter("@FAMILYANEMIABOX", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Familyanemiabox);
            query.Parameters.Add(new MySqlParameter("@FAMILYANEMIA", MySqlDbType.String)).Value = icd.Familyanemia;
            query.Parameters.Add(new MySqlParameter("@FAMILYOTHERS", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Familyothers);
            query.Parameters.Add(new MySqlParameter("@FAMILYOTHERSNOTES", MySqlDbType.String)).Value = icd.Familyothersnotes;
            query.Parameters.Add(new MySqlParameter("@PASTILLNESSBOX", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Pastillnessbox);
            query.Parameters.Add(new MySqlParameter("@PASTILLNESS", MySqlDbType.String)).Value = icd.Pastillness;
            query.Parameters.Add(new MySqlParameter("@PASTSURGERYBOX", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Pastsurgerybox);
            query.Parameters.Add(new MySqlParameter("@PASTSURGERY", MySqlDbType.String)).Value = icd.Pastsurgery;
            query.Parameters.Add(new MySqlParameter("@PASTMEDICATIONSBOX", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Pastmedicationsbox);
            query.Parameters.Add(new MySqlParameter("@PASTMEDICATIONS", MySqlDbType.String)).Value = icd.Pastmedications;
            query.Parameters.Add(new MySqlParameter("@PASTALLERGYBOX", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Pastallergybox);
            query.Parameters.Add(new MySqlParameter("@ALLERGIES", MySqlDbType.String)).Value = icd.Allergies;
            query.Parameters.Add(new MySqlParameter("@ENVIROHISTORY", MySqlDbType.String)).Value = icd.Envirohistory;
            query.Parameters.Add(new MySqlParameter("@PSYCHOHISTORY", MySqlDbType.String)).Value = icd.Psychohistory;
            query.Parameters.Add(new MySqlParameter("@VITALT", MySqlDbType.String)).Value = icd.Vitalt;
            query.Parameters.Add(new MySqlParameter("@VITALWEIGHT", MySqlDbType.String)).Value = icd.Vitalweight;
            query.Parameters.Add(new MySqlParameter("@VITALHEIGHT", MySqlDbType.String)).Value = icd.Vitalheight;
            query.Parameters.Add(new MySqlParameter("@VITALBSA", MySqlDbType.String)).Value = icd.Vitalbsa;
            query.Parameters.Add(new MySqlParameter("@VITALRR", MySqlDbType.String)).Value = icd.Vitalrr;
            query.Parameters.Add(new MySqlParameter("@VITALHR", MySqlDbType.String)).Value = icd.Vitalhr;
            query.Parameters.Add(new MySqlParameter("@VITALBP", MySqlDbType.String)).Value = icd.Vitalbp;
            query.Parameters.Add(new MySqlParameter("@VITALPAIN", MySqlDbType.String)).Value = icd.Vitalpain;
            query.Parameters.Add(new MySqlParameter("@VITALPERFORM_LEV", MySqlDbType.String)).Value = icd.Vitalperform_lev;
            query.Parameters.Add(new MySqlParameter("@SKINLESIONS", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Skinlesions);
            query.Parameters.Add(new MySqlParameter("@SKINLESIONSNOTES", MySqlDbType.String)).Value = icd.Skinlesionsnotes;
            query.Parameters.Add(new MySqlParameter("@SKINNOLESIONS", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Skinnolesions);
            query.Parameters.Add(new MySqlParameter("@SKINLOCATION", MySqlDbType.String)).Value = icd.Skinlocation;
            query.Parameters.Add(new MySqlParameter("@HEENT_CONJ_NORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_conj_normal);
            query.Parameters.Add(new MySqlParameter("@HEENT_CONJ_PALE", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_conj_pale);
            query.Parameters.Add(new MySqlParameter("@HEENT_SCLERAE_NORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_sclerae_normal);
            query.Parameters.Add(new MySqlParameter("@HEENT_SCLERAE_YELLOW", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_sclerae_yellow);
            query.Parameters.Add(new MySqlParameter("@HEENT_THYR_NORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_thyr_normal);
            query.Parameters.Add(new MySqlParameter("@HEENT_THYR_ENLARGED", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_thyr_enlarged);
            query.Parameters.Add(new MySqlParameter("@HEENT_THYR_ENLARGEDNOTES", MySqlDbType.String)).Value = icd.Heent_thyr_enlargednotes;
            query.Parameters.Add(new MySqlParameter("@HEENT_CRN_NORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_crn_normal);
            query.Parameters.Add(new MySqlParameter("@HEENT_CRN_ENLARGED", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_crn_enlarged);
            query.Parameters.Add(new MySqlParameter("@HEENT_CRN_ENLARGEDNOTES", MySqlDbType.String)).Value = icd.Heent_crn_enlargednotes;
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_NORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tonsils_normal);
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_ENLARGED", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tonsils_enlarged);
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_EXUDATES", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tonsils_exudates);
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_BEEFY", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tonsils_beefy);
            query.Parameters.Add(new MySqlParameter("@HEENT_TM_NORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tm_normal);
            query.Parameters.Add(new MySqlParameter("@HEENT_TM_PERFORATED", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tm_perforated);
            query.Parameters.Add(new MySqlParameter("@HEENT_TM_DISCHARGED", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Heent_tm_discharged);
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_REGU", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Chestrythm_regu);
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_IRREG", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Chestrythm_irreg);
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_MURMUR", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Chestrythm_murmur);
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_THRILL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Chestrythm_thrill);
            query.Parameters.Add(new MySqlParameter("@CHESTBREAST_SMR", MySqlDbType.String)).Value = icd.Chestbreast_smr;
            query.Parameters.Add(new MySqlParameter("@LUNGSNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Lungsnormal);
            query.Parameters.Add(new MySqlParameter("@LUNGSABNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Lungsabnormal);
            query.Parameters.Add(new MySqlParameter("@LUNGSABNORMALNOTES", MySqlDbType.String)).Value = icd.Lungsabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@EXTREMITIESNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Extremitiesnormal);
            query.Parameters.Add(new MySqlParameter("@EXTREMITIESABNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Extremitiesabnormal);
            query.Parameters.Add(new MySqlParameter("@EXTREMITIESABNORMALNOTES", MySqlDbType.String)).Value = icd.Extremitiesabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@RECTALNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Rectalnormal);
            query.Parameters.Add(new MySqlParameter("@RECTALABNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Rectalabnormal);
            query.Parameters.Add(new MySqlParameter("@RECTALABNORMALNOTES", MySqlDbType.String)).Value = icd.Rectalabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@ENDOCRINENORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Endocrinenormal);
            query.Parameters.Add(new MySqlParameter("@ENDOCRINEABNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Endocrineabnormal);
            query.Parameters.Add(new MySqlParameter("@ENDOCRINEABNORMALNOTES", MySqlDbType.String)).Value = icd.Endocrineabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@HEMATOLOGICNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Hematologicnormal);
            query.Parameters.Add(new MySqlParameter("@HEMATOLOGICABNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Hematologicabnormal);
            query.Parameters.Add(new MySqlParameter("@HEMATOLOGICABNORMALNOTES", MySqlDbType.String)).Value = icd.Hematologicabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@GENITALIANORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Genitalianormal);
            query.Parameters.Add(new MySqlParameter("@GENITALIAABNORMAL", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Genitaliaabnormal);
            query.Parameters.Add(new MySqlParameter("@GENITALIAABNORMALNOTES", MySqlDbType.String)).Value = icd.Genitaliaabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@SMRRATING", MySqlDbType.String)).Value = icd.Smrrating;
            query.Parameters.Add(new MySqlParameter("@PHYS_OTHERS", MySqlDbType.String)).Value = icd.Phys_others;
            query.Parameters.Add(new MySqlParameter("@PHYS_PERFLEVEL", MySqlDbType.String)).Value = icd.Phys_perflevel;
            query.Parameters.Add(new MySqlParameter("@CBCHGB", MySqlDbType.String)).Value = icd.Cbchgb;
            query.Parameters.Add(new MySqlParameter("@CBCHCT", MySqlDbType.String)).Value = icd.Cbchct;
            query.Parameters.Add(new MySqlParameter("@CBCPLATELET", MySqlDbType.String)).Value = icd.Cbcplatelet;
            query.Parameters.Add(new MySqlParameter("@CBCWBC", MySqlDbType.String)).Value = icd.Cbcwbc;
            query.Parameters.Add(new MySqlParameter("@CBCSTABS", MySqlDbType.String)).Value = icd.Cbcstabs;
            query.Parameters.Add(new MySqlParameter("@CBCSEG", MySqlDbType.String)).Value = icd.Cbcseg;
            query.Parameters.Add(new MySqlParameter("@CBCL", MySqlDbType.String)).Value = icd.Cbcl;
            query.Parameters.Add(new MySqlParameter("@CBCM", MySqlDbType.String)).Value = icd.Cbcm;
            query.Parameters.Add(new MySqlParameter("@CBCE", MySqlDbType.String)).Value = icd.Cbce;
            query.Parameters.Add(new MySqlParameter("@CBCBLAST", MySqlDbType.String)).Value = icd.Cbcblast;
            query.Parameters.Add(new MySqlParameter("@CBCRETICULYTE_COUNT", MySqlDbType.String)).Value = icd.Cbcreticulyte_count;
            query.Parameters.Add(new MySqlParameter("@CBCRPI", MySqlDbType.String)).Value = icd.Cbcrpi;
            query.Parameters.Add(new MySqlParameter("@CBCMCHC", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Cbcmchc);
            query.Parameters.Add(new MySqlParameter("@CBCMCHCNOTES", MySqlDbType.String)).Value = icd.Cbcmchcnotes;
            query.Parameters.Add(new MySqlParameter("@CBCMCH", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Cbcmch);
            query.Parameters.Add(new MySqlParameter("@CBCMCHNOTES", MySqlDbType.String)).Value = icd.Cbcmchnotes;
            query.Parameters.Add(new MySqlParameter("@CBCMCV", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Cbcmcv);
            query.Parameters.Add(new MySqlParameter("@CBCMCVNOTES", MySqlDbType.String)).Value = icd.Cbcmcvnotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARRBC", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Perismearrbc);
            query.Parameters.Add(new MySqlParameter("@PERISMEARRBCNOTES", MySqlDbType.String)).Value = icd.Perismearrbcnotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARANISO", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Perismearaniso);
            query.Parameters.Add(new MySqlParameter("@PERISMEARANISONOTES", MySqlDbType.String)).Value = icd.Perismearanisonotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARPOIKILO", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Perismearpoikilo);
            query.Parameters.Add(new MySqlParameter("@PERISMEARPOIKILONOTES", MySqlDbType.String)).Value = icd.Perismearpoikilonotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARWBC", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Perismearwbc);
            query.Parameters.Add(new MySqlParameter("@PERISMEARWBCNOTES", MySqlDbType.String)).Value = icd.Perismearwbcnotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARB", MySqlDbType.String)).Value = icd.Perismearb;
            query.Parameters.Add(new MySqlParameter("@PERISMEARN", MySqlDbType.String)).Value = icd.Perismearn;
            query.Parameters.Add(new MySqlParameter("@PERISMEARL", MySqlDbType.String)).Value = icd.Perismearl;
            query.Parameters.Add(new MySqlParameter("@PERISMEAR2B", MySqlDbType.String)).Value = icd.Perismear2b;
            query.Parameters.Add(new MySqlParameter("@PERISMEARE", MySqlDbType.String)).Value = icd.Perismeare;
            query.Parameters.Add(new MySqlParameter("@PERISMEARM", MySqlDbType.String)).Value = icd.Perismearm;
            query.Parameters.Add(new MySqlParameter("@PERISMEARBLAST", MySqlDbType.String)).Value = icd.Perismearblast;
            query.Parameters.Add(new MySqlParameter("@PERISMEARPLATELETS", MySqlDbType.Byte)).Value = Convert.ToByte(icd.Perismearplatelets);
            query.Parameters.Add(new MySqlParameter("@PERISMEARADEQ", MySqlDbType.String)).Value = icd.Perismearadeq;
            query.Parameters.Add(new MySqlParameter("@PERISMEARINC", MySqlDbType.String)).Value = icd.Perismearinc;
            query.Parameters.Add(new MySqlParameter("@PERISMEARDEC", MySqlDbType.String)).Value = icd.Perismeardec;
            query.Parameters.Add(new MySqlParameter("@PERISMEARMACRO", MySqlDbType.String)).Value = icd.Perismearmacro;
            query.Parameters.Add(new MySqlParameter("@PERISMEARMICRO", MySqlDbType.String)).Value = icd.Perismearmicro;
            query.Parameters.Add(new MySqlParameter("@PERISMEARINTERPRE", MySqlDbType.String)).Value = icd.Perismearinterpre;
            query.Parameters.Add(new MySqlParameter("@COAGPROFBLLEDTIME", MySqlDbType.String)).Value = icd.Coagprofblledtime;
            query.Parameters.Add(new MySqlParameter("@COAGPROFCLOTTIME", MySqlDbType.String)).Value = icd.Coagprofclottime;
            query.Parameters.Add(new MySqlParameter("@COAGPROFPT", MySqlDbType.String)).Value = icd.Coagprofpt;
            query.Parameters.Add(new MySqlParameter("@COAGPROFFDP", MySqlDbType.String)).Value = icd.Coagproffdp;
            query.Parameters.Add(new MySqlParameter("@COAGPROFAPTT", MySqlDbType.String)).Value = icd.Coagprofaptt;
            query.Parameters.Add(new MySqlParameter("@COAGPROFOTHERS", MySqlDbType.String)).Value = icd.Coagprofothers;
            query.Parameters.Add(new MySqlParameter("@COAGPROFVIII", MySqlDbType.String)).Value = icd.Coagprofviii;
            query.Parameters.Add(new MySqlParameter("@COAGPROFIX", MySqlDbType.String)).Value = icd.Coagprofix;
            query.Parameters.Add(new MySqlParameter("@COAGPROFFIBRI", MySqlDbType.String)).Value = icd.Coagproffibri;
            query.Parameters.Add(new MySqlParameter("@COAGPROFDMMERS", MySqlDbType.String)).Value = icd.Coagprofdmmers;
            query.Parameters.Add(new MySqlParameter("@PLATEAGGREGATIONTESTS", MySqlDbType.String)).Value = icd.Plateaggregationtests;
            query.Parameters.Add(new MySqlParameter("@HEMOGLOBINELECTRONOTES", MySqlDbType.String)).Value = icd.Hemoglobinelectronotes;
            query.Parameters.Add(new MySqlParameter("@BONEMSMERYTHROPOIESIS", MySqlDbType.String)).Value = icd.Bonemsmerythropoiesis;
            query.Parameters.Add(new MySqlParameter("@BONEMSMGRANULOPOIESIS", MySqlDbType.String)).Value = icd.Bonemsmgranulopoiesis;
            query.Parameters.Add(new MySqlParameter("@BONEMSMMEGAKARYOPOIESIS", MySqlDbType.String)).Value = icd.Bonemsmmegakaryopoiesis;
            query.Parameters.Add(new MySqlParameter("@BONEMSMOTHERS", MySqlDbType.String)).Value = icd.Bonemsmothers;
            query.Parameters.Add(new MySqlParameter("@BONEMSMINTERPRETATIONS", MySqlDbType.String)).Value = icd.Bonemsminterpretations;
            query.Parameters.Add(new MySqlParameter("@BONEMRBIOPSYDATE", MySqlDbType.DateTime)).Value = icd.Bonemrbiopsydate;
            query.Parameters.Add(new MySqlParameter("@BONEMRBIOPSYNOTES", MySqlDbType.String)).Value = icd.Bonemrbiopsynotes;
            query.Parameters.Add(new MySqlParameter("@HISTOPATHOLOGYDATE", MySqlDbType.DateTime)).Value = icd.Histopathologydate;
            query.Parameters.Add(new MySqlParameter("@HISTOPATHOLOGYNOTES", MySqlDbType.String)).Value = icd.Histopathologynotes;
            query.Parameters.Add(new MySqlParameter("@CHROMODATE", MySqlDbType.DateTime)).Value = icd.Chromodate;
            query.Parameters.Add(new MySqlParameter("@CHROMONOTES", MySqlDbType.String)).Value = icd.Chromonotes;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMDATE", MySqlDbType.DateTime)).Value = icd.Cytochemdate;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMPAS", MySqlDbType.String)).Value = icd.Cytochempas;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMMPO", MySqlDbType.String)).Value = icd.Cytochemmpo;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMSBB", MySqlDbType.String)).Value = icd.Cytochemsbb;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMOTHERS", MySqlDbType.String)).Value = icd.Cytochemothers;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENODATE", MySqlDbType.DateTime)).Value = icd.Immunophenodate;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD3", MySqlDbType.String)).Value = icd.Immunophenocd3;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD5", MySqlDbType.String)).Value = icd.Immunophenocd5;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD7", MySqlDbType.String)).Value = icd.Immunophenocd7;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD10", MySqlDbType.String)).Value = icd.Immunophenocd10;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOANTIHLADR", MySqlDbType.String)).Value = icd.Immunophenoantihladr;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD13", MySqlDbType.String)).Value = icd.Immunophenocd13;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD19", MySqlDbType.String)).Value = icd.Immunophenocd19;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD20", MySqlDbType.String)).Value = icd.Immunophenocd20;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD22", MySqlDbType.String)).Value = icd.Immunophenocd22;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD33", MySqlDbType.String)).Value = icd.Immunophenocd33;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD34", MySqlDbType.String)).Value = icd.Immunophenocd34;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOOTHERS", MySqlDbType.String)).Value = icd.Immunophenoothers;
            query.Parameters.Add(new MySqlParameter("@BONESCANDATE", MySqlDbType.DateTime)).Value = icd.Bonescandate;
            query.Parameters.Add(new MySqlParameter("@BONESCANNOTES", MySqlDbType.String)).Value = icd.Bonescannotes;
            query.Parameters.Add(new MySqlParameter("@CTSCANDATE", MySqlDbType.DateTime)).Value = icd.Ctscandate;
            query.Parameters.Add(new MySqlParameter("@CTSCANNOTES", MySqlDbType.String)).Value = icd.Ctscannotes;
            query.Parameters.Add(new MySqlParameter("@CHESTXRAYDATE", MySqlDbType.DateTime)).Value = icd.Chestxraydate;
            query.Parameters.Add(new MySqlParameter("@CHESTXRAYNOTES", MySqlDbType.String)).Value = icd.Chestxraynotes;
            query.Parameters.Add(new MySqlParameter("@LABDATAOTHERS", MySqlDbType.String)).Value = icd.Labdataothers;
            query.Parameters.Add(new MySqlParameter("@IMPRESSIONDIAGNOSIS", MySqlDbType.String)).Value = icd.Impressiondiagnosis;
            query.Parameters.Add(new MySqlParameter("@OTHERNOTES", MySqlDbType.String)).Value = icd.Othernotes;

            return dbConnect.nonQueryExecute(query);
        }
        public bool addTemp(int last_id)
        {
         MySqlCommand query = new MySqlCommand(@"INSERT INTO incdata(p_id, chiefcompliant, hpi, bcg, dtp, opvipv, hib, hepb, mmr, vari, hpv, otherimmunization, familycancerbox,familycancer, familyhemo,
         familyvwf, familyanemiabox,familyanemia, familyothers, familyothersnotes, pastillnessbox, pastillness, pastsurgerybox, pastsurgery, pastmedicationsbox, pastmedications,pastallergybox, allergies, envirohistory, psychohistory,
 vitalt, vitalweight, vitalheight, vitalbsa, vitalrr, vitalhr, vitalbp, vitalpain, vitalperform_lev, skinlesions, skinlesionsnotes, skinnolesions, skinlocation,
 heent_conj_normal, heent_conj_pale, heent_sclerae_normal, heent_sclerae_yellow, heent_thyr_normal, heent_thyr_enlarged, heent_thyr_enlargednotes, heent_crn_normal, heent_crn_enlarged,
 heent_crn_enlargednotes, heent_tonsils_normal, heent_tonsils_enlarged, heent_tonsils_exudates, heent_tonsils_beefy, heent_tm_normal, heent_tm_perforated, heent_tm_discharged, 
 chestrythm_regu, chestrythm_irreg, chestrythm_murmur, chestrythm_thrill, chestbreast_smr, lungsnormal, lungsabnormal, lungsabnormalnotes, extremitiesnormal, extremitiesabnormal,
 extremitiesabnormalnotes, rectalnormal, rectalabnormal, rectalabnormalnotes, endocrinenormal, endocrineabnormal, endocrineabnormalnotes, hematologicnormal, hematologicabnormal,
 hematologicabnormalnotes, genitalianormal, genitaliaabnormal, genitaliaabnormalnotes, smrrating, phys_others, phys_perflevel, cbchgb, cbchct, cbcplatelet,
 cbcwbc, cbcstabs, cbcseg, cbcl, cbcm, cbce, cbcblast, cbcreticulyte_count, cbcrpi, cbcmchc, cbcmchcnotes, cbcmch, cbcmchnotes,
 cbcmcv, cbcmcvnotes, perismearrbc, perismearrbcnotes, perismearaniso, perismearanisonotes, perismearpoikilo, perismearpoikilonotes, perismearwbc, perismearwbcnotes,
 perismearb, perismearn, perismearl, perismear2b, perismeare, perismearm, perismearblast, perismearplatelets, perismearadeq, perismearinc,
 perismeardec, perismearmacro, perismearmicro, perismearinterpre, coagprofblledtime, coagprofclottime, coagprofpt, coagproffdp, coagprofaptt, coagprofothers,
 coagprofviii, coagprofix, coagproffibri, coagprofdmmers, plateaggregationtests, hemoglobinelectronotes, bonemsmerythropoiesis, bonemsmgranulopoiesis, bonemsmmegakaryopoiesis,
 bonemsmothers, bonemsminterpretations, bonemrbiopsydate, bonemrbiopsynotes, histopathologydate, histopathologynotes, chromodate, chromonotes, cytochemdate,
 cytochempas, cytochemmpo, cytochemsbb, cytochemothers, immunophenodate, immunophenocd3, immunophenocd5, immunophenocd7, immunophenocd10, immunophenoantihladr,
 immunophenocd13, immunophenocd19, immunophenocd20, immunophenocd22, immunophenocd33, immunophenocd34, immunophenoothers, bonescandate, bonescannotes, ctscandate,
 ctscannotes, chestxraydate, chestxraynotes, labdataothers, impressiondiagnosis, othernotes) VALUES(@P_ID, @CHIEFCOMPLIANT, @HPI, @BCG, @DTP, @OPVIPV, @HIB, @HEPB, @MMR, @VARI, @HPV, @OTHERIMMUNIZATION, @FAMILYCANCERBOX, @FAMILYCANCER, @FAMILYHEMO,
 @FAMILYVWF, @FAMILYANEMIABOX, @FAMILYANEMIA, @FAMILYOTHERS, @FAMILYOTHERSNOTES,@PASTILLNESSBOX, @PASTILLNESS, @PASTSURGERYBOX,@PASTSURGERY, @PASTMEDICATIONSBOX,@PASTMEDICATIONS, @PASTALLERGYBOX,@ALLERGIES, @ENVIROHISTORY, @PSYCHOHISTORY,
 @VITALT, @VITALWEIGHT, @VITALHEIGHT, @VITALBSA, @VITALRR, @VITALHR, @VITALBP, @VITALPAIN, @VITALPERFORM_LEV, @SKINLESIONS, @SKINLESIONSNOTES, @SKINNOLESIONS, @SKINLOCATION,
 @HEENT_CONJ_NORMAL, @HEENT_CONJ_PALE, @HEENT_SCLERAE_NORMAL, @HEENT_SCLERAE_YELLOW, @HEENT_THYR_NORMAL, @HEENT_THYR_ENLARGED, @HEENT_THYR_ENLARGEDNOTES, @HEENT_CRN_NORMAL, @HEENT_CRN_ENLARGED,
 @HEENT_CRN_ENLARGEDNOTES, @HEENT_TONSILS_NORMAL, @HEENT_TONSILS_ENLARGED, @HEENT_TONSILS_EXUDATES, @HEENT_TONSILS_BEEFY, @HEENT_TM_NORMAL, @HEENT_TM_PERFORATED, @HEENT_TM_DISCHARGED, 
 @CHESTRYTHM_REGU, @CHESTRYTHM_IRREG, @CHESTRYTHM_MURMUR, @CHESTRYTHM_THRILL, @CHESTBREAST_SMR, @LUNGSNORMAL, @LUNGSABNORMAL, @LUNGSABNORMALNOTES, @EXTREMITIESNORMAL, @EXTREMITIESABNORMAL,
 @EXTREMITIESABNORMALNOTES, @RECTALNORMAL, @RECTALABNORMAL, @RECTALABNORMALNOTES, @ENDOCRINENORMAL, @ENDOCRINEABNORMAL, @ENDOCRINEABNORMALNOTES, @HEMATOLOGICNORMAL, @HEMATOLOGICABNORMAL,
 @HEMATOLOGICABNORMALNOTES, @GENITALIANORMAL, @GENITALIAABNORMAL, @GENITALIAABNORMALNOTES, @SMRRATING, @PHYS_OTHERS, @PHYS_PERFLEVEL, @CBCHGB, @CBCHCT, @CBCPLATELET,
 @CBCWBC, @CBCSTABS, @CBCSEG, @CBCL, @CBCM, @CBCE, @CBCBLAST, @CBCRETICULYTE_COUNT, @CBCRPI, @CBCMCHC, @CBCMCHCNOTES, @CBCMCH, @CBCMCHNOTES,
 @CBCMCV, @CBCMCVNOTES, @PERISMEARRBC, @PERISMEARRBCNOTES, @PERISMEARANISO, @PERISMEARANISONOTES, @PERISMEARPOIKILO, @PERISMEARPOIKILONOTES, @PERISMEARWBC, @PERISMEARWBCNOTES,
 @PERISMEARB, @PERISMEARN, @PERISMEARL, @PERISMEAR2B, @PERISMEARE, @PERISMEARM, @PERISMEARBLAST, @PERISMEARPLATELETS, @PERISMEARADEQ, @PERISMEARINC,
 @PERISMEARDEC, @PERISMEARMACRO, @PERISMEARMICRO, @PERISMEARINTERPRE, @COAGPROFBLLEDTIME, @COAGPROFCLOTTIME, @COAGPROFPT, @COAGPROFFDP, @COAGPROFAPTT, @COAGPROFOTHERS,
 @COAGPROFVIII, @COAGPROFIX, @COAGPROFFIBRI, @COAGPROFDMMERS, @PLATEAGGREGATIONTESTS, @HEMOGLOBINELECTRONOTES, @BONEMSMERYTHROPOIESIS, @BONEMSMGRANULOPOIESIS, @BONEMSMMEGAKARYOPOIESIS,
 @BONEMSMOTHERS, @BONEMSMINTERPRETATIONS, @BONEMRBIOPSYDATE, @BONEMRBIOPSYNOTES, @HISTOPATHOLOGYDATE, @HISTOPATHOLOGYNOTES, @CHROMODATE, @CHROMONOTES, @CYTOCHEMDATE,
 @CYTOCHEMPAS, @CYTOCHEMMPO, @CYTOCHEMSBB, @CYTOCHEMOTHERS, @IMMUNOPHENODATE, @IMMUNOPHENOCD3, @IMMUNOPHENOCD5, @IMMUNOPHENOCD7, @IMMUNOPHENOCD10, @IMMUNOPHENOANTIHLADR,
 @IMMUNOPHENOCD13, @IMMUNOPHENOCD19, @IMMUNOPHENOCD20, @IMMUNOPHENOCD22, @IMMUNOPHENOCD33, @IMMUNOPHENOCD34, @IMMUNOPHENOOTHERS, @BONESCANDATE, @BONESCANNOTES, @CTSCANDATE,
 @CTSCANNOTES, @CHESTXRAYDATE, @CHESTXRAYNOTES, @LABDATAOTHERS, @IMPRESSIONDIAGNOSIS, @OTHERNOTES)", dbConnect.getConnection());
         query.Parameters.Add(new MySqlParameter("@P_ID", MySqlDbType.Int32)).Value = last_id;
         query.Parameters.Add(new MySqlParameter("@CHIEFCOMPLIANT", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@HPI", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@BCG", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@DTP", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@OPVIPV", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HIB", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEPB", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@MMR", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@VARI", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HPV", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@OTHER", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@OTHERIMMUNIZATION", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@FAMILYCANCERBOX", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@FAMILYCANCER", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@FAMILYHEMO", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@FAMILYVWF", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@FAMILYANEMIABOX", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@FAMILYANEMIA", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@FAMILYOTHERS", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@FAMILYOTHERSNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PASTILLNESSBOX", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@PASTILLNESS", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PASTSURGERYBOX", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@PASTSURGERY", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PASTMEDICATIONSBOX", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@PASTMEDICATIONS", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PASTALLERGYBOX", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@ALLERGIES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@ENVIROHISTORY", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PSYCHOHISTORY", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALT", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALWEIGHT", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALHEIGHT", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALBSA", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALRR", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALHR", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALBP", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALPAIN", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@VITALPERFORM_LEV", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@SKINLESIONS", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@SKINLESIONSNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@SKINNOLESIONS", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@SKINLOCATION", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@HEENT_CONJ_NORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_CONJ_PALE", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_SCLERAE_NORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_SCLERAE_YELLOW", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_THYR_NORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_THYR_ENLARGED", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_THYR_ENLARGEDNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@HEENT_CRN_NORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_CRN_ENLARGED", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_CRN_ENLARGEDNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_NORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_ENLARGED", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_EXUDATES", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_BEEFY", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_TM_NORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_TM_PERFORATED", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEENT_TM_DISCHARGED", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_REGU", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_IRREG", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_MURMUR", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_THRILL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@CHESTBREAST_SMR", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@LUNGSNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@LUNGSABNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@LUNGSABNORMALNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@EXTREMITIESNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@EXTREMITIESABNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@EXTREMITIESABNORMALNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@RECTALNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@RECTALABNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@RECTALABNORMALNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@ENDOCRINENORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@ENDOCRINEABNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@ENDOCRINEABNORMALNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@HEMATOLOGICNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEMATOLOGICABNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@HEMATOLOGICABNORMALNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@GENITALIANORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@GENITALIAABNORMAL", MySqlDbType.Byte)).Value = 0;
         query.Parameters.Add(new MySqlParameter("@GENITALIAABNORMALNOTES", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@SMRRATING", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PHYS_OTHERS", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@PHYS_PERFLEVEL", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@CBCHGB", MySqlDbType.String)).Value = "";
         query.Parameters.Add(new MySqlParameter("@CBCHCT", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCPLATELET", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCWBC", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCSTABS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCSEG", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCL", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCM", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCE", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCBLAST", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCRETICULYTE_COUNT", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCRPI", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCMCHC", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@CBCMCHCNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCMCH", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@CBCMCHNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CBCMCV", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@CBCMCVNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARRBC", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@PERISMEARRBCNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARANISO", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@PERISMEARANISONOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARPOIKILO", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@PERISMEARPOIKILONOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARWBC", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@PERISMEARWBCNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARB", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARN", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARL", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEAR2B", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARE", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARM", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARBLAST", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARPLATELETS", MySqlDbType.Byte)).Value = 0;
            query.Parameters.Add(new MySqlParameter("@PERISMEARADEQ", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARINC", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARDEC", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARMACRO", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARMICRO", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PERISMEARINTERPRE", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFBLLEDTIME", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFCLOTTIME", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFPT", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFFDP", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFAPTT", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFOTHERS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFVIII", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFIX", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFFIBRI", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@COAGPROFDMMERS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@PLATEAGGREGATIONTESTS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@HEMOGLOBINELECTRONOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONEMSMERYTHROPOIESIS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONEMSMGRANULOPOIESIS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONEMSMMEGAKARYOPOIESIS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONEMSMOTHERS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONEMSMINTERPRETATIONS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONEMRBIOPSYDATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@BONEMRBIOPSYNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@HISTOPATHOLOGYDATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@HISTOPATHOLOGYNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CHROMODATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@CHROMONOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMDATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMPAS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMMPO", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMSBB", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMOTHERS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENODATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD3", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD5", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD7", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD10", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOANTIHLADR", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD13", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD19", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD20", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD22", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD33", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD34", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOOTHERS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@BONESCANDATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@BONESCANNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CTSCANDATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@CTSCANNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@CHESTXRAYDATE", MySqlDbType.DateTime)).Value = DateTime.Parse("2011 - 08 - 19");
            query.Parameters.Add(new MySqlParameter("@CHESTXRAYNOTES", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@LABDATAOTHERS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@IMPRESSIONDIAGNOSIS", MySqlDbType.String)).Value = "";
            query.Parameters.Add(new MySqlParameter("@OTHERNOTES", MySqlDbType.String)).Value = "";

            return dbConnect.nonQueryExecute(query);
    }
        public bool Update(Patient pasyente)
        {
            MySqlCommand query = new MySqlCommand(@"UPDATE incdata SET p_fname = @P_FNAME,  p_lname = @P_LNAME,  p_mname = @P_MNAME, p_bday = @P_BDAY , p_sex = @P_SEX,  
            p_address = @P_ADDRESS,  p_telnum = @P_TELNUM,  p_cnumber = @P_CNUMBER,  p_fathername = @P_FATHERNAME,  p_fatheroccu = @P_FATHEROCCU, 
            p_mothername = @P_MOTHERNAME,  p_motheroccu = @P_MOTHEROCCU, p_siblingcnt = @SIBLINGCNT,  p_annualincome = @ANNUALINCOME,  p_referral = @P_REFERRAL)", dbConnect.getConnection());
            return dbConnect.nonQueryExecute(query);

        }
    }
}
